<%--
  Created by IntelliJ IDEA.
  User: KangFaWei
  Date: 2019/6/26
  Time: 8:55
  To change this template use File | Settings | File Templates.
--%>
<%@ page contentType="text/html;charset=UTF-8" language="java" %>
<%
    String path = request.getContextPath();
%>
<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %>
<jsp:include page="/web/inc/header"/>
<section>
    <div class="wrap">
        <div id="seach">
            <div id="logo"><a href="http://fenlicx.qinglab.cn" title="垃圾分类查询">分类查询</a></div>

        </div>
        <nav>

        </nav>
        <form id="formSubmit" class="article" action="<%=path%>/web/garbage/insertSolution" method="post">
            <div data-id="${requestScope.garbage.id}" class="title">
                <h1>添加${requestScope.garbage.name}处理方案</h1>
            </div>
            <div class="publish">
                <dl>
                    <dd>
                        <input name="garbage.id" value="${requestScope.garbage.id}" type="hidden"/>
                    </dd>
                    <dd>
                        <textarea class="write-content" id="content" name="content" cols="" rows=""></textarea>
                    </dd>
                </dl>
                <div style="float: left;margin-left: 0px" class="submit">
                    <input type="submit" name="submit" id="submit" value="提交">
                    <input type="reset" name="submit" id="submit2" value="重置">
                </div>
            </div>
        </form>
    </div>
</section>
<script src="<%=path%>/static/js/jquery-3.3.1.min.js"></script>
<!-- 配置文件 -->
<script type="text/javascript" src="<%=path%>/ueditor/ueditor.config.js"></script>
<!-- 编辑器源码文件 -->
<script type="text/javascript" src="<%=path%>/ueditor/ueditor.all.js"></script>
<!-- 实例化编辑器 -->
<script type="text/javascript">
    var ue = UE.getEditor('content', {
        toolbars: [
            [
                'bold',//加粗
                'italic',//斜体
                'superscript', //上标
                'subscript', //下标
                'indent', //首行缩进
                'simpleupload', //单图上传
                'link', //超链接
            ]
        ]
    });
    ue.ready(function () {
        ue.setHeight(200);
    })
    $(function () {
        $("#formSubmit").submit(check);

        //判断在线编辑器中的内容
        function check() {
            if (ue.getContent().trim() == "") {
                alert("请输入处理方案");
                // layer.msg("不能少于5个字符",{icon:5},function () {
                //
                // });
                return false;
            }
            else {
                return true;
            }

        }
    });
</script>
<jsp:include page="/web/inc/footer"/>

